/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/

package org.jfab.core.factory;

import org.jfab.core.collection.CGAnnotationList;
import org.jfab.core.collection.CGFieldList;
import org.jfab.core.collection.CGPropertyList;
import org.jfab.core.collection.CGTypeList;
import org.jfab.core.collection.CommentList;
import org.jfab.core.collection.ModifierList;
import org.jfab.core.model.CGField;
import org.jfab.core.model.CGProperty;
import org.jfab.core.model.CGType;

/**
 * Defines methods required by a code generator field factory.
 */
public interface CGFieldFactory
{
    /**
     * @return a new default serial version ID field.
     */
    CGField createDefaultSerialVersionIdField();

    /**
     * @param property Property.
     * 
     * @return a new code generator field.
     */
    CGField createField(CGProperty property);

    /**
     * @param fieldType Field type.
     * @param fieldName Field name.
     * 
     * @return a new code generator field.
     */
    CGField createField(CGType fieldType, String fieldName);

    /**
     * @param fieldType Field type.
     * @param fieldName Field name.
     * @param initialValue Initial value.
     * 
     * @return a new code generator field.
     */
    CGField createField(CGType fieldType, String fieldName, String initialValue);

    /**
     * @param referencedTypes Referenced types.
     * @param commentLines Comment lines.
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * @param fieldType Field type.
     * @param fieldName Field name.
     * @param initialValue Initial value.
     * @param isGetter Flag indicating whether this field requires a getter
     *            method.
     * @param isSetter Flag indicating whether this field requires a setter
     *            method.
     * @param isUsedInIdentity Flag indicating whether this field is included in
     *            object identity.
     * 
     * @return a new code generator field.
     */
    CGField createField(CGTypeList referencedTypes, CommentList commentLines,
            CGAnnotationList annotations, ModifierList modifiers,
            CGType fieldType, String fieldName, String initialValue,
            Boolean isGetter, Boolean isSetter, Boolean isUsedInIdentity);

    /**
     * @return a new instance factory field.
     */
    CGField createInstanceFactoryField();

    /**
     * @param fields Fields.
     * 
     * @return a new list of property change constant fields.
     */
    CGFieldList createPropertyChangeConstantFields(CGFieldList fields);

    /**
     * @param properties Properties.
     * 
     * @return a new list of property change constant fields.
     */
    CGFieldList createPropertyChangeConstantFields(CGPropertyList properties);

    /**
     * @return a new property change support field.
     */
    CGField createPropertyChangeSupportField();

    /**
     * @param property Property.
     * 
     * @return a new field representing the given property.
     */
    CGField createPropertyField(CGField property);

    /**
     * @param properties Properties.
     * 
     * @return a new collection of fields representing the given properties.
     */
    CGFieldList createPropertyFields(CGFieldList properties);
}
